﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLKhachSan.DTO;
using System.Data;
using System.Data.SqlClient;

namespace QLKhachSan.DAO
{
    public class DAO_CTBangKeDichVu
    {
        public static void themCTBangKeDichVu(DTO_CTBangKeDichVu p)
        {
            string[] name = new string[4] { "@MaBangKe","@MaDV","@SoLuong","@ThoiGian"};
            object[] ob = new object[4] { p.MaBangKe,p.MaDV,p.SoLuong,p.ThoiGian };
            clsKetNoi.ThucThiLenhCoTS("pr_ThemCTBangKeDichVu", name, ob, 4);
        }
        public static DataTable hienthiDanhSachCTBangKeDichVu()
        {
            return clsKetNoi.Load("pr_HienThiCTBangKeDichVu");
        }
        public static void suaCTBangKeDichVu(DTO_CTBangKeDichVu p)
        {
            string[] name = new string[5] { "@MaCTBangKe","@MaBangKe", "@MaDV", "@SoLuong", "@ThoiGian" };
            object[] ob = new object[5] { p.MaCTBangKe,p.MaBangKe, p.MaDV, p.SoLuong, p.ThoiGian };
            clsKetNoi.ThucThiLenhCoTS("pr_SuaCTBangKeDichVu", name, ob, 5);
        }
        public static void xoaCTBangKeDichVu(DTO_CTBangKeDichVu p)
        {
            string[] name = new string[1] { "@MaCTBangKe" };
            object[] ob = new object[1] { p.MaCTBangKe };
            clsKetNoi.ThucThiLenhCoTS("pr_XoaCTBangKeDichVu", name, ob, 1);
        }
        public static DataTable hienthiDanhSachCTBangKeDichVuTheoMaBangKe(DTO_CTBangKeDichVu p)
        {
            string[] name = new string[1] { "@MaBangKe" };
            object[] ob = new object[1] { p.MaBangKe };
            return clsKetNoi.LoadCoTS("pr_HienThiCTBangKeTheoMaBangKe",name,ob,1);
        }
        
        public static DataTable hienthiDanhSachCTBangKeDichVuDeThanhToan(DTO_BangKeDichVu p)
        {
            string[] name = new string[1] { "@MaKH" };
            object[] ob = new object[1] { p.MaKH };
            return clsKetNoi.LoadCoTS("pr_HienThiDichVuDeThanhToanTheoMaKH", name, ob, 1);
        }
       
        public static DataTable hienthiDanhSachCTBangKeDichVuThongKe()
        {
            return clsKetNoi.Load("pr_HienThiCTBangKeThongKe");
        }
    }
}
